home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / shmem_lock.z / shmem_lock
Encoding:
Text File  |  2002-10-03  |  4.3 KB  |  66 lines

  1.  
  2. SHMEM_LOCK(3)                                                 SHMEM_LOCK(3)
  3.  
  4.  
  5. NNNNAAAAMMMMEEEE
  6.      sssshhhhmmmmeeeemmmm____cccclllleeeeaaaarrrr____lllloooocccckkkk, sssshhhhmmmmeeeemmmm____sssseeeetttt____lllloooocccckkkk, sssshhhhmmmmeeeemmmm____tttteeeesssstttt____lllloooocccckkkk - Releases, locks,
  7.      and tests a mutual exclusion memory lock
  8.  
  9. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  10.      C or C++:
  11.  
  12.         ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>>
  13.  
  14.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____cccclllleeeeaaaarrrr____lllloooocccckkkk((((lllloooonnnngggg ****_l_o_c_k))));;;;
  15.  
  16.         vvvvooooiiiidddd sssshhhhmmmmeeeemmmm____sssseeeetttt____lllloooocccckkkk((((lllloooonnnngggg ****_l_o_c_k))));;;;
  17.  
  18.         iiiinnnntttt sssshhhhmmmmeeeemmmm____tttteeeesssstttt____lllloooocccckkkk((((lllloooonnnngggg ****_l_o_c_k))));;;;
  19.  
  20.      Fortran:
  21.  
  22.         IIIINNNNTTTTEEEEGGGGEEEERRRR _l_o_c_k, SSSSHHHHMMMMEEEEMMMM____TTTTEEEESSSSTTTT____LLLLOOOOCCCCKKKK
  23.  
  24.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____CCCCLLLLEEEEAAAARRRR____LLLLOOOOCCCCKKKK((((_l_o_c_k))))
  25.  
  26.         CCCCAAAALLLLLLLL SSSSHHHHMMMMEEEEMMMM____SSSSEEEETTTT____LLLLOOOOCCCCKKKK((((_l_o_c_k))))
  27.  
  28.         IIII ==== SSSSHHHHMMMMEEEEMMMM____TTTTEEEESSSSTTTT____LLLLOOOOCCCCKKKK((((_l_o_c_k))))
  29.  
  30. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  31.      The sssshhhhmmmmeeeemmmm____sssseeeetttt____lllloooocccckkkk routine sets a mutual exclusion lock after waiting
  32.      for the lock to be freed by any other PE currently holding the lock.
  33.      Waiting PEs are assured of getting the lock in a first-come,
  34.      first-served manner.
  35.  
  36.      The sssshhhhmmmmeeeemmmm____cccclllleeeeaaaarrrr____lllloooocccckkkk routine releases a lock previously set by
  37.      sssshhhhmmmmeeeemmmm____sssseeeetttt____lllloooocccckkkk after ensuring that all local and remote stores
  38.      initiated in the critical region are complete.
  39.  
  40.      The sssshhhhmmmmeeeemmmm____tttteeeesssstttt____lllloooocccckkkk function sets a mutual exclusion lock only if it
  41.      is currently cleared.  By using this function, a PE can avoid blocking
  42.      on a set lock.  If the lock is currently set, the function returns
  43.      without waiting.
  44.  
  45.      These routines are appropriate for protecting a critical region from
  46.      simultaneous update by multiple PEs.  They accept the following
  47.      argument:
  48.  
  49.      _l_o_c_k      A symmetric data object that is a scalar variable or an
  50.                array of length 1.  This data object must be set to 0 on all
  51.                processing elements (PEs) prior to the first use.  _l_o_c_k must
  52.                be of type integer.  If you are using Fortran, it must be of
  53.                default kind.
  54.  
  55. NNNNOOOOTTTTEEEESSSS
  56.      The term _s_y_m_m_e_t_r_i_c _d_a_t_a _o_b_j_e_c_t is defined on iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3).
  57.  
  58. RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  59.      The sssshhhhmmmmeeeemmmm____tttteeeesssstttt____lllloooocccckkkk function returns 0 if the lock was originally
  60.      cleared and this call was able to set the lock.  A value of 1 is
  61.      returned if the lock had been set and the call returned without
  62.      waiting to set the lock.
  63.  
  64. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  65.      iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3)
  66.